<?php
define('PUN_ROOT', './');
require 'config.php';
require PUN_ROOT.'include/dblayer/common_db.php';
require PUN_ROOT.'include/functions.php';
require PUN_ROOT.'include/utf8/utf8.php';

$sql = 'CREATE TABLE '.$db_prefix."reports (
					id INTEGER NOT NULL,
					poster_ip VARCHAR(39),
					posttime INTEGER NOT NULL DEFAULT 0,
					realname VARCHAR(200) NOT NULL DEFAULT '',
					username VARCHAR(200) NOT NULL DEFAULT '',
					W_country VARCHAR(200) NOT NULL DEFAULT '',
					W_state VARCHAR(200) NOT NULL DEFAULT '',
					W_city VARCHAR(200) NOT NULL DEFAULT '',
					W_town VARCHAR(200) NOT NULL DEFAULT '',
					work VARCHAR(200) NOT NULL DEFAULT '',
					educationleve VARCHAR(200) NOT NULL DEFAULT '',
					email VARCHAR(200) NOT NULL DEFAULT '',
					imid VARCHAR(200) NOT NULL DEFAULT '',
					b_year INTEGER NOT NULL DEFAULT 0,
					b_month INTEGER NOT NULL DEFAULT 0,
					b_day INTEGER NOT NULL DEFAULT 0,
					s_year INTEGER NOT NULL DEFAULT 0,
					s_month INTEGER NOT NULL DEFAULT 0,
					s_day INTEGER NOT NULL DEFAULT 0,
					s_hour INTEGER NOT NULL DEFAULT 0,
					time_seg VARCHAR(200) NOT NULL DEFAULT '',
					s_country VARCHAR(200) NOT NULL DEFAULT '',
					s_state VARCHAR(200) NOT NULL DEFAULT '',
					s_city VARCHAR(200) NOT NULL DEFAULT '',
					s_town VARCHAR(200) NOT NULL DEFAULT '',
					s_time_day VARCHAR(200) NOT NULL DEFAULT '',
					s_time_h VARCHAR(200) NOT NULL DEFAULT '',
					s_time_min VARCHAR(200) NOT NULL DEFAULT '',
					temp VARCHAR(200) NOT NULL DEFAULT '',
					weather VARCHAR(200) NOT NULL DEFAULT '',
					wind VARCHAR(200) NOT NULL DEFAULT '',
					is_thunder VARCHAR(200) NOT NULL DEFAULT '',
					climate VARCHAR(200) NOT NULL DEFAULT '',
					topography VARCHAR(200) NOT NULL DEFAULT '',
					vegetation VARCHAR(200) NOT NULL DEFAULT '',
					position VARCHAR(200) NOT NULL DEFAULT '',
					lunar VARCHAR(200) NOT NULL DEFAULT '',
					option_num VARCHAR(200) NOT NULL DEFAULT '',
					distance VARCHAR(200) NOT NULL DEFAULT '',
					uma_size VARCHAR(200) NOT NULL DEFAULT '',
					uma_form VARCHAR(200) NOT NULL DEFAULT '',
					undirect INTEGER NOT NULL DEFAULT 0,
					appear INTEGER NOT NULL DEFAULT 0,
					uma_appear TEXT,
					disappear INTEGER NOT NULL DEFAULT 0,
					uma_disappear TEXT,
					witness INTEGER NOT NULL DEFAULT 0,
					person_num VARCHAR(200) NOT NULL DEFAULT '',
					move_style VARCHAR(200) NOT NULL DEFAULT '',
					uma_color VARCHAR(200) NOT NULL DEFAULT '',
					uma_sound INTEGER NOT NULL DEFAULT 0,
					uma_voice TEXT,
					smell INTEGER NOT NULL DEFAULT 0,
					uma_smell TEXT,
					option_cc INTEGER NOT NULL DEFAULT 0,
					option_cs INTEGER NOT NULL DEFAULT 0,
					option_tf INTEGER NOT NULL DEFAULT 0,
					uma_marks VARCHAR(200) NOT NULL DEFAULT '',
					v_form VARCHAR(200) NOT NULL DEFAULT '',
					skin_type VARCHAR(200) NOT NULL DEFAULT '',
					skin_matter VARCHAR(200) NOT NULL DEFAULT '',
					animal_type VARCHAR(200) NOT NULL DEFAULT '',
					other_animal INTEGER NOT NULL DEFAULT 0,
					vehicle INTEGER NOT NULL DEFAULT 0,
					sickness VARCHAR(200) NOT NULL DEFAULT '',
					mentality VARCHAR(200) NOT NULL DEFAULT '',
					bases INTEGER NOT NULL DEFAULT 0,
					what_obj VARCHAR(200) NOT NULL DEFAULT '',
					evidence INTEGER NOT NULL DEFAULT 0,
					filelink VARCHAR(256) NOT NULL DEFAULT '',
					invested INTEGER NOT NULL DEFAULT 0,
					warned INTEGER NOT NULL DEFAULT 0,
					acc_sec INTEGER NOT NULL DEFAULT 0,
					PRIMARY KEY (id)
					)";

$db->query($sql) or error('Unable to create table '.$db_prefix.'reports. Please check your settings and try again.',  __FILE__, __LINE__, $db->error());
